<template>
    <el-dialog :title="titleMap[mode]" v-model="visible" :width="800"  destroy-on-close @closed="$emit('closed')" align-center >
        <el-main class="nopadding">
            <scTable ref="table" :apiObj="apiObj" row-key="id" :params="query" height="550" hidePagination hideDo>
                <el-table-column label="备注" prop="remark" align="center"></el-table-column>
                <el-table-column label="附件" prop="create_time" align="center">
                    <template #default="scope">
                    <el-popover v-if="scope.row.enclosure" placement="bottom" title="附件" width="500" trigger="click">
						<template #reference>
							<el-button type="primary" size="small">查看</el-button>
						</template>
						<sc-upload-file v-model="scope.row.enclosure" :is_same_name="1" disabled>
							<el-button type="primary" icon="el-icon-upload">选择文件</el-button>
						</sc-upload-file>
					</el-popover>
                    <span v-else></span>
				</template>
                </el-table-column>
                <el-table-column label="状态" prop="status" align="center">
                    <template #default="{row}">
                        {{row.status == 0 ? '预发' : row.status == 1 ? '在途' : row.status == 2 ? '到港' :row.status == 3 ? '转运' : row.status == 4 ? '清关' : row.status == 5 ? '出关运输' : '入库'}}
                    </template>
                </el-table-column>
                <el-table-column label="日期" prop="date" align="center"></el-table-column>
                <el-table-column label="创建时间" prop="create_time" align="center"></el-table-column>
                <el-table-column label="操作人" prop="admin.name" align="center"></el-table-column>
            </scTable>
        </el-main>
		<template #footer>
			<el-button @click="visible = false">取 消</el-button>
		</template>
	</el-dialog>
</template>

<script>
export default {
    props: {
        query: { type: Object, default: () => ({}) },
    },
	emits: ['success', 'closed'],
	data() {
		return {
			dialog: {
				client: false
			},
			mode: "add",
			titleMap: {
				add: '新增销售',
				edit: '查看状态修改记录',
				show: '查看'
			},
			visible: false,
			isSaveing: false,
            apiObj: this.$API.ware.ware.send.statusList,
		}
	},
	mounted() {
	},
	methods: {
		//显示
		open(mode = 'add') {
			this.mode = mode;
			this.visible = true;
			return this
		},
	}
}
</script>

<style lang="scss">
.el-input-group__append{
    padding: 0 8px;
}
</style>
